<!DOCTYPE html>
<html lang="en">
<head>
    {include file="common/meta_new" /}

    <link rel="stylesheet" type="text/css" href="/static/css/noticeBulletinPage.css">
    <style>
        .loading{
            text-align: center;
            height: 0.3rem;
            line-height: 0.3rem;
            margin-top: 0.15rem;
            color: #C0C0C0;
            font-size: 12px;

        }
    </style>
</head>
<body class="F6">
<div id="app" class="notice-bulletin-page">
    <!-- header -->
    <div class="header">
        <div class="header-height"></div>
        <div class="header-wrap">
            <div class="header-content">
                <div class="left">
                    <a href="{:url('index/index/index');}"><div class="go-back"><img src="/static/images/go-back.png" alt=""></div></a>
                    <div class="text">通知公告</div>
                </div>
                <div class="title"></div>
            </div>
        </div>
    </div>
    <div id="rm_con">

    </div>


<!--    <div class="group">
        <div class="date">2023年7月3日 09:16</div>
        <div class="card">
            <div class="title ellipsis-1">618活动预热开启，快去选购属于您的最</div>
            <div class="text ellipsis-2">视频号值不值得企业布局？肯定是值得的，因为现阶段的视频号正处于上升期，视频号的内容生态、直播生态正在逐渐完善，能给</div>
        </div>
    </div>

    <div class="group">
        <div class="date">2023年7月3日 09:16</div>
        <div class="card">
            <div class="title ellipsis-1">618活动预热开启，快去选购属于您的最</div>
            <div class="text ellipsis-2">视频号值不值得企业布局？肯定是值得的，因为现阶段的视频号正处于上升期，视频号的内容生态、直播生态正在逐渐完善，能给</div>
        </div>
    </div>-->

    <!-- <button class="btn">修改</button> -->
</div>
<script src="/static/js/common.js"></script>
<script>
           function getScrollTop() {
                var scrollTop = 0;
                if (document.documentElement && document.documentElement.scrollTop) {
                    scrollTop = document.documentElement.scrollTop;
                } else if (document.body) {
                    scrollTop = document.body.scrollTop;
                }
                return scrollTop;
            }
            function getClientHeight() {
                var clientHeight = 0;
                if (document.body.clientHeight && document.documentElement.clientHeight) {
                    clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight);
                } else {
                    clientHeight = Math.max(document.body.clientHeight, document.documentElement.clientHeight);
                }
                return clientHeight;
            }
            function getScrollHeight() {
                return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
            }

            var page = 1;
            var lock = 1;
            function load_html(result) {
                var lists = result.data;
                if (lists.length > 0) {
                    for (i = 0, ii = lists.length; i < ii; i++) {
                        var tmp_html = '';
                        var tmp_data = lists[i];
          
 
                        tmp_html += '<div onclick="gotoDetail('+tmp_data.id+')" class="group">';
                        tmp_html += '    <div class="date">'+tmp_data.createtime_format+'</div>';
                        tmp_html += '    <div class="card">';
                        tmp_html += '        <div class="title ellipsis-1">'+tmp_data.title+'</div>';
                        tmp_html += '        <div class="text ellipsis-2">'+tmp_data.summary+'</div>';
                        tmp_html += '    </div>';
                        tmp_html += '</div>';
    //                    if (tmp_data.m_qrcode != '') {
    //                        tmp_html = tmp_html + '<div class="rm_ewm" id="' + tmp_data.mobile + '"><img src="/assets/img2/ewm.png"></div>';
    //                    }
    //                    tmp_html = tmp_html + '</div>';
                        $('#rm_con').append(tmp_html);
                    }
                    if (lists.length <= 0) {
                        $('#rm_con').append('<div class="loading">- 加载完成 -</div>');
                    } else {
                        lock = 0;//解除加载锁
                    }
                } else {
                    $('#rm_con').append('<div class="loading">- 加载完成 -</div>');
                }
            }
            function load_url(keyword) {
                var url = '{:url("index/Notice/list",[],false)}';
                $.get(url,{"page":page,"keyword":keyword}, function (ret) {
                    load_html(ret);
                }, 'json');
            }

            $(function () {
                $(window).scroll(function () {
                    var sH = getScrollHeight();
                    var sT = getScrollTop();
                    var cH = getClientHeight();
                    if (sH - cH - sT < 50) {
                        if (lock == 0) {
                            lock = 1;//防止重复加载
                            page = page + 1;
                            var s_key = $("#phoneNum").val();
                            load_url(s_key);
                        }
                    }
                    console.log(sH + ',' + sT + ',' + cH);
                });
                var s_key = $("#phoneNum").val();
                load_url(s_key);
            });
            $('#keyword').on('input', function () {
                page = 1;
                var s_key = $("#keyword").val();
                $('#rm_con').html('');
                load_url(s_key);
            });
            
      function gotoDetail(id){
          window.location.href = "{:url('index/Notice/detail','','',true)}?id="+id;
      }
</script>
</body>
</html>